<template>
	<view class="donate_info">
		<view class="title">捐赠信息</view>
		<view class="tabs">
			<view class="item" :class="donor_type==1?'active':''" @click="donor_type=1">个人</view>
			<view class="item" :class="donor_type==2?'active':''" @click="donor_type=2">企业/单位</view>
		</view>
		<view class="list" v-if="donor_type==1">
			<view class="cell">
				<view class="label">姓名</view>
				<input v-model="donor_name" placeholder="请输入您的姓名" />
			</view>
			<view class="cell">
				<view class="label">联系电话</view>
				<input v-model="donor_phone" placeholder="请输入您的电话" />
			</view>
			<view class="cell">
				<view class="label">学校</view>
				<input v-model="donor_school" placeholder="请输入您的学校" />
			</view>
			<view class="cell">
				<view class="label">年级</view>
				<input v-model="donor_grade" placeholder="请输入您的年级" />
			</view>
			<view class="cell">
				<view class="label">专业</view>
				<input v-model="donor_major" placeholder="请输入您的专业" />
			</view>
		</view>
		<view class="list" v-else>
			<view class="cell">
				<view class="label">公司名称</view>
				<input v-model="donor_company" placeholder="请输入您的公司名称" />
			</view>
			<view class="cell">
				<view class="label">联系电话</view>
				<input v-model="donor_phone" placeholder="请输入您的电话" />
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				donor_type: 1,
				donor_name: "",
				donor_phone: "",
				donor_school: "",
				donor_grade: "",
				donor_major: "",
				donor_company: ""
			}
		},
		methods: {
			getData() {
				return {
					donor_type: this.donor_type,
					donor_name: this.donor_name,
					donor_phone: this.donor_phone,
					donor_school: this.donor_school,
					donor_grade: this.donor_grade,
					donor_major: this.donor_major,
					donor_company: this.donor_company
				}
			}
		}
	}
</script>

<style scoped lang="scss">
	.donate_info {
		background: #FFFFFF;
		border-radius: 24rpx 24rpx 24rpx 24rpx;
		padding: 28rpx 0rpx;
		box-sizing: border-box;

		.title {
			height: 36rpx;
			line-height: 36rpx;
			font-weight: bold;
			font-size: 28rpx;
			color: #333333;
			padding-left: 20rpx;
			box-sizing: border-box;
			position: relative;

			&::after {
				content: "";
				width: 12rpx;
				height: 36rpx;
				background: #FF8133;
				border-radius: 6rpx 6rpx 6rpx 6rpx;
				position: absolute;
				left: 0;
				top: 0;
			}
		}

		.tabs {
			display: flex;
			margin: 20rpx 0;

			.item {
				height: 56rpx;
				line-height: 56rpx;
				text-align: center;
				font-size: 24rpx;
				color: #333333;
				padding: 0 36rpx;
				background: #EFEFEF;
				border-radius: 8rpx 8rpx 8rpx 8rpx;
				margin-right: 20rpx;

				&.active {
					color: #FF8133;
					background: rgba(255, 129, 51, 0.2);
					border-radius: 8rpx 8rpx 8rpx 8rpx;
					border: 2rpx solid #FF8133;
				}
			}
		}

		.list {
			.cell {
				display: flex;
				margin-bottom: 36rpx;
				justify-content: space-between;

				&:last-child {
					margin-bottom: 0;
				}

				.label {
					font-size: 28rpx;
					color: #333333;
				}

				input {
					font-size: 28rpx;
					text-align: right;
				}
			}
		}
	}
</style>